import { defineStore } from 'pinia'
interface UserState {
  // userInfo: Nullable<UserInfo>
  token?: string
  // roleList: RoleEnum[]
  sessionTimeout?: boolean
  lastUpdateTime: number
}

export const useUserStore = defineStore({
  id: 'app-user',
  state: (): UserState => ({
    // user info
    // userInfo: null,
    // token
    token: undefined,
    // roleList
    // roleList: [],
    // Whether the login expired
    sessionTimeout: false,
    // Last fetch time
    lastUpdateTime: 0,
  }),
})
